﻿function Enroll() {
    var offic_name = $('#offic_name').val();
    var login_name = $('#login_name').val();
    var password = $('#password').val();
    if (offic_name == '' || login_name == '' || password == '') {
        layer.msg('请填写完整信息', { icon: 2, time: 1000 });
    }
    var model = JSON.stringify({
        login_name: login_name,
        password: password,
        no: $('#no').val(),
        name: $('#name').val(),
        email: $('#email').val(),
        phone: $('#phone').val(),
        user_type: $('#user_type:checked').val(),
        sex: $('input[name="sex"]:checked').val(),
        mgr_type: $('input[name="mgr_type"]:checked').val(),
        avatar: '',
        login_flag: $('input[name="useable"]:checked').val(),

    });
    var token = localStorage.getItem("token");
    // token = localStorage.getItem("token");
    console.log(token);
    //  console.log(model);
    $.ajax({
        url: "../User/UserAddDo",
        type: "post",
        data: { model: model, token: token },
        // contentType: "application/json",

        success: function (res) {
            console.log(res);
            //debugger;
            var ressult = JSON.parse(res)
            if (ressult.code == 200) {
                alert(ressult.message)

                //window.location.href = "/Carrier/Index"
            }
            else {
                alert(ressult.message)
            }
        }



    })



}

